
package com.cskaoyan.bean.wx.order;

import com.cskaoyan.bean.wx.order.GoodsInOrder;
import com.cskaoyan.bean.wx.order.HandleOption;
import lombok.Data;

import java.util.List;

/**
 * @author LiangRuiJiang
 * @since 2022/06/08  14:35
 */
@Data
public class WxMarketOrderVo {

    private Double actualPrice;
    private Integer aftersaleStatus;
    private List<GoodsInOrder> goodsList;
    private HandleOption handleOption = new HandleOption();
    private Integer id;
    private boolean isGroupin;
    private String orderSn;
    //
    private String orderStatusText;

    private Integer orderStatus;

    public void setOrderStatus(Integer orderStatus) {
        this.orderStatus = orderStatus;
        if(orderStatus == 101){
            this.orderStatusText = "未付款";
            handleOption.setPay(true);
            handleOption.setCancel(true);
        }else if(orderStatus == 102){
            this.orderStatusText = "用户取消";
        }else if (orderStatus == 103){
            this.orderStatusText = "系统取消";
        }else if(orderStatus == 201){
            handleOption.setRefund(true);
            this.orderStatusText = "已付款";
        }else if(orderStatus == 202){
            handleOption.setRefund(false);
            this.orderStatusText = "申请退款";
        }else if(orderStatus == 203){
            this.orderStatusText = "已退款";
        }else if(orderStatus == 301){
            handleOption.setConfirm(true);
            this.orderStatusText = "已发货";
        }else if(orderStatus == 401){
            handleOption.setAftersale(true);
            handleOption.setRebuy(true);
            handleOption.setComment(true);
            handleOption.setDelete(true);
            this.orderStatusText = "已收货";
        }else if(orderStatus == 402){
            this.orderStatusText = "系统收货";
        }
    }

}

